﻿using System.Linq;
using Microsoft.Owin;
using Microsoft.Owin.Cors;
using Owin;

[assembly: OwinStartup(typeof(XF.Meeting.Api.App_Start.Startup))]

namespace XF.Meeting.Api.App_Start
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            //QuartzConfig.StartUpdateState();
            //QuartzConfig.GetWXInfo();
            //QuartzConfig.AddJobsForMinute<SendWxMsg>("wxSendMsg", 1, "");
          
            app.UseCors(CorsOptions.AllowAll);
            app.Use((context, next) =>

            {

                if (context.Request.Headers.Any(k => k.Key.Contains("Origin")) && context.Request.Method == "OPTIONS")

                {

                    context.Response.StatusCode = 200;

                    return context.Response.WriteAsync("handled");

                }
                return next.Invoke();

            });
         //   GlobalHost.DependencyResolver.UseStackExchangeRedis("www.gaigai2020.xyz", 6379,"","signalRR");
           // app.MapSignalR();
            // 有关如何配置应用程序的详细信息，请访问 https://go.microsoft.com/fwlink/?LinkID=316888
        }
    }
}
